
import request from '@/utils/request'
export default {

    //添加盘点
    add(data) {
        const url = `/v3/inventory/invcount/add`
        return request({
            url: url,
            method: 'post',
            data: {
                ...data,
                organizationNo: sessionStorage.getItem('organizationNo'),
                systemNo: sessionStorage.systemNo
            }
        })
    },
    //添加详情
    addInfo(data) {
        const url = `/v3/inventory/invcountDetail/add`
        return request({
            url: url,
            method: 'post',
            data: {
                ...data,
                organizationNo: sessionStorage.getItem('organizationNo'),
                systemNo: sessionStorage.systemNo
            }
        })
    },
    //添加盘点
    delList(list) {
        const url = `/v3/inventory/invcount/delListByNo`
        return request({
            url: url,
            method: 'post',
            data: {
                noList: list,
            }
        })
    },
    //获取仓库物料
    queryMaterialByStordocNo(no) {
        const url = `/v3/inventory/onHandQuantity/queryMaterialByStordocNo?no=${no}&systemNo=${sessionStorage.systemNo}`
        return request({
            url: url,
            method: 'get'
        })
    },
    //查询盘点
    queryPageByCondition(data) {
        const url = `/v3/inventory/invcount/queryPageByCondition`
        return request({
            url: url,
            method: 'post',
            data: {
                ...data,
                entity: {
                    ...data.entity,
                    systemNo: sessionStorage.systemNo
                }
            }
        })
    },
    //盘点详情
    invcountDetail(data) {
        const url = `/v3/inventory/invcountDetail/queryByCondition`
        return request({
            url: url,
            method: 'post',
            data: {
                ...data,
                systemNo: sessionStorage.systemNo
            }
        })
    },
    //查询仓库物料行号
    queryOnHandQuantity(params) {
        const url = `/v3/inventory/invcountDetail/queryOnHandQuantity`
        return request({
            url: url,
            method: 'get',
            params
        })
    },
    // 条件查询
    conditionQuery(params) {
        return request({
            url: '/v3/inventory/stordoc/queryByCondition',
            method: 'post',
            data: {
                ...params,
                systemNo: sessionStorage.systemNo
            }
        })
    },
    //获取仓库列表 *代表必填
    pageQuery(params) {
        return request.post('/v3/inventory/stordoc/queryPageByCondition', {
            ...params,
            entity:{
              ...params.entity,
              systemNo:sessionStorage.systemNo
            }
          })
    },
    //添加仓库
    addStordoc(params) {
        return request.post('/v3/inventory/stordoc/add', {...params,systemNo:sessionStorage.systemNo})
    },
    //编辑仓库
    editStordoc(params) {
        return request.post('/v3/inventory/stordoc/edit', {...params,systemNo:sessionStorage.systemNo})
    },
    // 批量删除仓库
    delStordocList(list) {
        return request.post('/v3/inventory/stordoc/delListByNo', { noList: list })
    },
}
